import mpay.Account
import mpay.Bank

class BootStrap {

    def init = { servletContext ->

        def kasikornBank = new Bank(name: 'Kasikorn Bank', shortName: 'KBank').save(flush: true, failOnError: true)
        def krungThaiBank = new Bank(name: 'Krung Thai Bank', shortName: 'KTB').save(flush: true, failOnError: true)
        def scb = new Bank(name: 'Siam Commercial Bank', shortName: 'SCB').save(flush: true, failOnError: true)
        def uob = new Bank(name: 'United Overseas Bank', shortName: 'UOB').save(flush: true, failOnError: true)
        def bangkokBank = new Bank(name: 'Bangkok Bank', shortName: 'BKB').save(flush: true, failOnError: true)

        def systemProfile = new Account(
                mobile: '0850102145',
                pin: 'pimmy1234!'.encodeAsMD5(),
                confirmationCode: '4everus',
                account: '7122420064',
                bankName: kasikornBank,
                isActive: true).save(flush: true, failOnError: true)

        def nOteProfile = new Account(
                mobile: '0865819592',
                pin: 'nOte555!'.encodeAsMD5(),
                confirmationCode: 'hithere',
                account: '0150053339',
                bankName: krungThaiBank,
                isActive: true).save(flush: true, failOnError: true)

        def kaeProfile = new Account(
                mobile: '0859506888',
                pin: 'kae182!'.encodeAsMD5(),
                confirmationCode: 'helloWorld',
                account: '9250048445',
                bankName: scb,
                isActive: true).save(flush: true, failOnError: true)

        def kwanProfile = new Account(
                mobile: '0891229696',
                pin: 'mickey777!'.encodeAsMD5(),
                confirmationCode: 'immickey',
                account: '2032261790',
                bankName: uob,
                isActive: true).save(flush: true, failOnError: true)


    }
    def destroy = {
    }
}

